package com.qianclass.talklive.app.adapter;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.qianclass.talklive.app.bean.CatalogBean;

import java.util.List;

/**
 * Author:  Administrator-li
 * Date:    2017/6/6     9:18
 * TODO:    
 */

public class CatalogListAdapter extends BaseAdapter{

    private Context           mContext;
    private List<CatalogBean> mCatalogLists;

    public CatalogListAdapter(Context context, List<CatalogBean> catalogLists){
        mContext = context;
        mCatalogLists = catalogLists;
    }

    @Override
    public int getCount() {
        return mCatalogLists != null ? mCatalogLists.size() : 0;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        TextView textView = new TextView(mContext);
        textView.setTextSize(18);
        textView.setGravity(Gravity.CENTER_VERTICAL);
        textView.setPadding(5,5,5,5);
        textView.setText(mCatalogLists.get(position).getFileName());

        return textView;
    }
}
